package com.night.icm.service.base.mapper;

import com.night.icm.model.base.SystemDictionaryValueDTO;
import com.night.icm.persistence.base.entity.SystemDictionaryValue;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.ReportingPolicy;

/**
 * DictionaryValueMapper
 *
 * @author Liao ZhiYong
 * @date 2019/12/27
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DictionaryValueMapper {

    /**
     * DTO转为实体
     *
     * @param systemDictionaryValueDTO dto
     * @return 实体
     */
    SystemDictionaryValue toEntity(SystemDictionaryValueDTO systemDictionaryValueDTO);

    /**
     * 实体转为DTO
     *
     * @param systemDictionaryValue 实体
     * @return dto
     */
    SystemDictionaryValueDTO toDTO(SystemDictionaryValue systemDictionaryValue);

    /**
     * 更新一个已存在的实体
     *
     * @param systemDictionaryValueDTO 新的数据
     * @param systemDictionaryValue    已知实体
     */
    void updateEntity(SystemDictionaryValueDTO systemDictionaryValueDTO, @MappingTarget SystemDictionaryValue systemDictionaryValue);
}
